﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FineUI;
using OnlineTestBLL;
using OnlineTestModel;

namespace OnlineTestUI.BackManager
{
    public partial class addteacher : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void BtAdd_Click(object sender, EventArgs e)
        {
            Teachers t = new Teachers();
            TeachersBLL tb = new TeachersBLL();
            t.RealName = tbRealName.Text;
            t.UserName = tbUserName.Text;
            t.PassWord = tbPassWord.Text;
            t.Description = tbDescription.Text;
            t.RoleId = Convert.ToInt32(tbRoleId.Text);
            t.RoleList = tbRoleList.Text;
            t.Status = 1;
            t.CreateTime = DateTime.Now;
            t.CreateId = 1;
            //t.CreateId = ((Teachers)Session["teacher"]).Id;
            t.LastLoginTime = null;
            int result = tb.Add(t);
            if (result > 0)
            {
                PageContext.Redirect("teacherlist.aspx", "_self");
            }
        }
    }
}